<!-- xml version="1.0" encoding="utf-8" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<title>Greek Online</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="../flashcard.css" rel="stylesheet" type="text/css">
</head>


<script type="text/javascript">
var sentences = [
  [ ['δηλοῖ', 'δέ', 'μοι', 'καὶ', 'τόδε', 'τῶν', 'παλαιῶν', 'ἀσθένειαν', 'οὐχ', 'ἤκιστα·'],
    ['it is clear', 'but', 'to me', 'also', 'by this', 'of the', 'ancient', 'weakness', 'not', 'least'],
    ['<span class="verbum">δηλόω</span> <span class="vtype">v.</span> <span class="def">be clear, reveal</span>',
     '<span class="verbum">δέ</span> <span class="vtype">particle.</span> <span class="def">and, on the other hand</span>',
     '<span class="verbum">ἐγώ</span> <span class="vtype">pron.</span> <span class="def">I</span>',
     '<span class="verbum">καί</span> <span class="vtype">conj.</span> <span class="def">and</span>',
     '<span class="verbum">ὅδε, ἡδε, τόδε</span> <span class="vtype">pron.</span> <span class="def">this</span>',
     '<span class="verbum">ὁ, ἡ, τό</span> <span class="vtype">article.</span> <span class="def">the</span>',
     '<span class="verbum">παλαιός, παλαιά, παλαιόν</span> <span class="vtype">adj.</span> <span class="def">old, ancient</span>',
     '<span class="verbum">ἀσθένεια, ἀσθένειᾱς, ἡ</span> <span class="vtype">f.</span> <span class="def">weakness</span>',
     '<span class="verbum">οὐ</span> <span class="vtype">particle.</span> <span class="def">not</span>',
     '<span class="verbum">ἥκιστα</span> <span class="vtype">adv.</span> <span class="def">least</span>'] ],
  [ ['πρὸ', 'γὰρ', 'τῶν', 'Τρωικῶν', 'οὐδὲν', 'φαίνεται', 'πρότερον', 'κοινῇ', 'ἐργασαμένη', 'ἡ', 'Ἑλλάς·'],
    ['before', 'for', 'of the', 'the times of Troy', 'nothing', 'appears', 'before', 'in common', 'to have done', 'the', 'Greece'],
    ['<span class="verbum">πρό</span> <span class="vtype">prep.</span> <span class="def">before</span>',
     '<span class="verbum">γάρ</span> <span class="vtype">conj.</span> <span class="def">for</span>',
     '<span class="verbum">ὁ, ἡ, τό</span> <span class="vtype">article.</span> <span class="def">the</span>',
     '<span class="verbum">Τρωικός, Τρωική, Τρωικόν</span> <span class="vtype">adj.</span> <span class="def">Trojan</span>',
     '<span class="verbum">οὐδείς, οὐδεμία, οὐδέν</span> <span class="vtype">pron.</span> <span class="def">no one, nothing</span>',
     '<span class="verbum">φαίνω</span> <span class="vtype">v.</span> <span class="def">bring to light, make visible</span>',
     '<span class="verbum">πρότερον</span> <span class="vtype">adv.</span> <span class="def">earlier, before</span>',
     '<span class="verbum">κοινός, κοινή, κοινόν</span> <span class="vtype">adj.</span> <span class="def">common</span>',
     '<span class="verbum">ἐργάζομαι</span> <span class="vtype">dep.</span> <span class="def">work, make</span>',
     '<span class="verbum">ὁ</span> <span class="vtype">article.</span> <span class="def">the</span>',
     '<span class="verbum">Ἑλλάς, Ἑλλάδος, ἡ</span> <span class="vtype">f.</span> <span class="def">Greece</span>'] ],
  [ ['δοκεῖ', 'δέ', 'μοι,', 'οὐδὲ', 'τοὄνομα', 'τοῦτο', 'ξύμπασά', 'πω', 'εἶχεν,'],
    ['it seems', 'indeed', 'to me', 'not', 'this name', 'this', 'in general', 'yet', 'had'],
    ['<span class="verbum">δοκέω</span> <span class="vtype">v.</span> <span class="def">seem, think</span>',
     '<span class="verbum">δέ</span> <span class="vtype">particle.</span> <span class="def">and, on the other hand</span>',
     '<span class="verbum">ἐγώ</span> <span class="vtype">pron.</span> <span class="def">I</span>',
     '<span class="verbum">οὐδέ</span> <span class="vtype">particle.</span> <span class="def">not</span>',
     '<span class="verbum">ὄνομα, ὄνοματος, τό</span> <span class="vtype">n.</span> <span class="def">name</span>',
     '<span class="verbum">οὗτος, αὕτη, τοῦτο</span> <span class="vtype">pron.</span> <span class="def">this</span>',
     '<span class="verbum">σύμπᾱς/ξύμπας, σύμπᾱσα, σύμπᾰν</span> <span class="vtype">adj.</span> <span class="def">all together</span>',
     '<span class="verbum">πω</span> <span class="vtype">adv.</span> <span class="def">yet</span>',
     '<span class="verbum">ἔχω</span> <span class="vtype">v.</span> <span class="def">have</span>'] ],
  [ ['ἀλλὰ', 'τὰ', 'μὲν', 'πρὸ', 'Ἕλληνος', 'τοῦ', 'Δευκαλίωνος', 'καὶ', 'πάνυ', 'οὐδὲ', 'εἶναι', 'ἡ', 'ἐπίκλησις', 'αὕτη,'],
    ['but', 'that', 'on the other hand', 'before', 'the time of Hellen', 'of the', '(son) of Deucalion', 'even', 'entirely', 'not', 'to exist', 'the', 'title', 'this'],
    ['<span class="verbum">ἀλλά</span> <span class="vtype">conj.</span> <span class="def">but</span>',
     '<span class="verbum">ὁ, ἡ, τό</span> <span class="vtype">article.</span> <span class="def">the</span>',
     '<span class="verbum">μέν</span> <span class="vtype">particle.</span> <span class="def">on the one hand</span>',
     '<span class="verbum">πρό</span> <span class="vtype">prep.</span> <span class="def">before</span>',
     '<span class="verbum">Ἕλλην, Ἕλληνος, ὁ</span> <span class="vtype">m.</span> <span class="def">Hellen, son of Deucalion</span>',
     '<span class="verbum">ὁ, ἡ, τό</span> <span class="vtype">article.</span> <span class="def">the</span>',
     '<span class="verbum">Δευκαλίων, Δευκαλίωνος, ὁ</span> <span class="vtype">m.</span> <span class="def">Deucalion</span>',
     '<span class="verbum">καί</span> <span class="vtype">conj.</span> <span class="def">and, also, even</span>',
     '<span class="verbum">πάνυ</span> <span class="vtype">adv.</span> <span class="def">altogether, entirely</span>',
     '<span class="verbum">οὐδέ</span> <span class="vtype">particle.</span> <span class="def">not</span>',
     '<span class="verbum">εἰμί</span> <span class="vtype">v.</span> <span class="def">to be</span>',
     '<span class="verbum">ὁ, ἡ, τό</span> <span class="vtype">article.</span> <span class="def">the</span>',
     '<span class="verbum">ἐπίκλησις, ἐπίκλησεως, ἡ</span> <span class="vtype">f.</span> <span class="def">name, title</span>',
     '<span class="verbum">οὗτος, αὕτη, τοῦτο</span> <span class="vtype">pron.</span> <span class="def">this</span>'] ]
];

var i = 0;
var j = 0;

var shown = 0;

function updateVoc() {
	
	var sentence = "";
	
	for(n = 0; n < sentences[i][0].length; n++) {
		if (n == j) {
			sentence += ' <span class="curword">' + sentences[i][0][n] + "</span>";
		} else {
			sentence += " " + sentences[i][0][n];
		}
	}
	
	document.getElementById('gktxt').innerHTML = sentence;
	
	if (shown == 0) {
		document.getElementById('v1').innerHTML = "";
		document.getElementById('v2').innerHTML = "";
	} else if (shown == 1) {
		document.getElementById('v1').innerHTML = sentences[i][1][j];
		document.getElementById('v2').innerHTML = "";
	} else if (shown == 2) {
		document.getElementById('v1').innerHTML = sentences[i][1][j];
		document.getElementById('v2').innerHTML = sentences[i][2][j];
	}
}

function next() {
	shown++;
	if (shown > 2) {
		shown = 0;
		j++;
		if (j >= sentences[i][0].length) {
			j = 0;
			i++;
			if (i >= sentences.length) {
				i = 0;
				alert('All done!');
			}
		}
	}
	updateVoc();
}

function prev() {
	shown--;
	if (shown < 0) {
		shown = 2;
		j--;
		
		if (j < 0) {
			i--;
			if (i < 0) {
				i = sentences.length - 1;
				alert('All done!');
			}
			j = sentences[i][0].length - 1;
		}
	}
	
	updateVoc();
}


function nextt() {
	shown = 0;
	j = 0;
	i++;
	if (i >= sentences.length) {
		i = 0;
		alert('All done!');
	}

	updateVoc();
}

function prevv() {
	shown = 0;
	j = 0;
	i--;
	if (i < 0) {
		i = sentences.length - 1;
		alert('All done!');
	}
	j = sentences[i][0].length - 1;
	
	updateVoc();
}

</script>

<body onload="updateVoc()">
<h1 style="text-align:center; color: #60B0C0;">Thucydides’ History of the Peloponnesian War, Book 1</h1>

<div class="center">
<div id="gktxt" class="gktxt"></div>
<div id="v1" class="v1"></div>
<div id="v2" class="v2"></div>

<a href="#" class="button" id="btnprevv" onclick="prevv()">&lt;&lt;</a>
<a href="#" class="button" id="btnprev" onclick="prev()" accesskey="p">&lt;</a>
<a href="#" class="button" id="btnnext" onclick="next()" accesskey="n">&gt;</a>
<a href="#" class="button" id="btnnextt" onclick="nextt()">&gt;&gt;</a>


</div>
</body>
</html>
